<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<link href="css/layout.css" rel="stylesheet" type="text/css" />
	<link href="css/menu.css" rel="stylesheet" type="text/css" />

</h:head>

<h:body>
	<div class="container" align="center">

		<div id="upload">
			<h:form id="formUpload" enctype="multipart/form-data">
				<p:panel header="Enviar Arquivos">
					<p:messages id="messages1" showDetail="true" />

					<p:fileUpload id="file_upload" mode="advanced" required="true"
						style="margin-top: 15px;"
						requiredMessage="É necessário o envio de pelo menos um arquivo!"
						allowTypes="/(\.|\/)(gif|jpe?g|rtf|odt|png|doc|docx|xls|xlsx|pps|ppsx|ppt|pptx|pdf|jpg|zip|txt|7z|rar)$/"
						invalidFileMessage="Tipo de arquivo não permitido"
						invalidSizeMessage="Arquivo com tamanho acima do permitido"
						uploadLabel="Enviar Arquivos" cancelLabel="Cancelar"
						label="Selecionar..." multiple="true" sizeLimit="10485760"
						update="g_messages"
						fileUploadListener="#{uploadBean.recebeArquivos}"
						value="#{uploadBean.uploadedFile}" 
						oncomplete="formSucesso" />

					<p:growl id="g_messages" showDetail="true" />

				</p:panel>
			</h:form>
		</div>

	</div>

	<h:form id="formSucesso" prependId="false">
		<p:confirmDialog id="Sucesso"
			message="Arquivos carregados com sucesso"
			header="Sucesso" severity="alert" widgetVar="confirmation">

			<p:commandButton id="confirm" value="OK" style="center;"
				oncomplete="confirmation.hide()"
				update=":formUpload" />
		</p:confirmDialog>
	</h:form>
</h:body>
</html>